#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main()
{
    int num = 0;
    scanf("%d", &num);
    int sum = 0;
    while (num)
    {
        sum += num % 10;
        num /= 10;
    }
    printf("%d\n", sum);
    return 0;
}